var http = require('http');
var fs = require('fs');

/*下载图片*/
// http.createServer(function (req, res) {
//   res.writeHead(200, {'Content-Type': 'img/jpg'});
// fs.createReadStream('img.jpg').pipe(res); }).listen(3000);

/*读取文件内容*/
http.createServer(function(req,res){
	res.writeHead(200,{'Content-Type':'text/plain'});
	fs.createReadStream('resource').pipe(res).listen(3000);
})
console.log('Server running at http://localhost:3000/');
